home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / adl.zip / ADL.PAS < prev    next >
Pascal/Delphi Source File  |  1987-07-10  |  9KB  |  243 lines

  1. PROGRAM Write_ADL_File;  {Shareware version, ADL.PAS, 070987}
  2.  
  3.  
  4.         (***********************************************************)
  5.         (*                                                         *)
  6.         (*                    Automatic Download                   *)
  7.         (*                                                         *)
  8.         (*     ADL is designed to be used with Procomm 2.42        *)
  9.         (*     to speedup file downloads, especially from          *)
  10.         (*     the Source [as we all know can be very slow].       *)
  11.         (*                                                         *)
  12.         (*     ADL.COM must be run from DOS, either before         *)
  13.         (*     starting Procomm, or by using the Alt-F4 DOS        *)
  14.         (*     gateway if you are already in it.  I suppose        *)
  15.         (*     it could be your "editor" option for Alt-A          *)
  16.         (*     if you are not already using that option.           *)
  17.         (*                                                         *)
  18.         (*     ADL writes a file, ADL.CMD.  This file's sole       *)
  19.         (*     purpose is to assign values [the filenames to       *)
  20.         (*     be downloaded] to the Procomm CMD file              *)
  21.         (*     DL-xxxx.CMD, which it then calls via the            *)
  22.         (*     EXEC command.  This file then talks to the          *)
  23.         (*     BBS, or the Source, and downloads the files.        *)
  24.         (*     The maximum number of files is nine at a time.      *)
  25.         (*                                                         *)
  26.         (*     So...put ADL.COM on your disk somewhere; there      *)
  27.         (*     is an pathname option which lets you choose         *)
  28.         (*     where ADL.COM will be written.  Choose the          *)
  29.         (*     directory you run your CMD files from. Also         *)
  30.         (*     put the DL-xxxx.CMD files there.  Then from         *)
  31.         (*     DOS enter "ADL" [no quotes] and follow the          *)
  32.         (*     prompts.  When the ADL.CMD file is written,         *)
  33.         (*     go to, or return to, Procomm.  Hit Alt-F5 and       *)
  34.         (*     enter "ADL" [no quotes] again.  You must be         *)
  35.         (*     at the IBMSIG or PC-Board main prompts when         *)
  36.         (*     the CMD file is started.  That's it!                *)
  37.         (*                                                         *)
  38.         (*     In addition to the four DL-x.CMD files included     *)
  39.         (*     in this ARC file I have included the option         *)
  40.         (*     to name four other EXEC that can be called from     *)
  41.         (*     ADL.CMD:  DL-TBBS.CMD, DL-FIDO1.CMD,                *)
  42.         (*     DL-SPCL1.CMD, and DL-SPCL2.CMD.                     *)
  43.         (*     You can then write your own D/L Procomm files       *)
  44.         (*     for four other BBSs or whatever.                    *)
  45.         (*                                                         *)
  46.         (*     I don't know too much about the speed of the        *)
  47.         (*     DL-x CMD files, as the only machine I have to       *)
  48.         (*     test it on is an AT clone.  However, once run-      *)
  49.         (*     ning the DL- files, Procomm doesn't have to go      *)
  50.         (*     to the disk again until done.                       *)
  51.         (*                                                         *)
  52.         (*     I hope you like it!  Please share it with           *)
  53.         (*     anyone, but keep the ARC file intact.               *)
  54.         (*                                                         *)
  55.         (*                                                         *)
  56.         (*     Feedback is readily accepted at:                    *)
  57.         (*                                                         *)
  58.         (*     Pepper's Data System  (205) 626-7447                *)
  59.         (*     SourceMail, BEF697                                  *)
  60.         (*                                                         *)
  61.         (*            - or -                                       *)
  62.         (*                                                         *)
  63.         (*     Andrew Adams                                        *)
  64.         (*     Intelligent Alternatives                            *)
  65.         (*     2410 Hall's Mill Road                               *)
  66.         (*     Mobile, AL 36606                                    *)
  67.         (*     (205) 471-0005 (voice)                              *)
  68.         (*                                                         *)
  69.         (*     If you live in a PCP-accessable area I can call     *)
  70.         (*     you on your modem after 6 p.m. or weekends.         *)
  71.         (*     Or leave a message on Cotiere BBS, (404)            *)
  72.         (*     948-6596.                                           *)
  73.         (*                                                         *)
  74.         (***********************************************************)
  75.  
  76.  
  77. type
  78.   Str12    = string[12];
  79.   Str32    = string[32];
  80.  
  81. var
  82.   OutFile   : text;
  83.   OutChoice : integer;
  84.  
  85.  
  86. function NumWord (Counter : integer) : Str32;
  87. {Get a word as a function of the count}
  88.  
  89. begin
  90.   case Counter of
  91.     0 : NumWord := 'First';
  92.     1 : NumWord := 'Second';
  93.     2 : NumWord := 'Third';
  94.     3 : NumWord := 'Fourth';
  95.     4 : NumWord := 'Fifth';
  96.     5 : NumWord := 'Sixth';
  97.     6 : NumWord := 'Seventh';
  98.     7 : NumWord := 'Eighth';
  99.     8 : NumWord := 'Ninth'
  100.   end
  101. end;
  102.  
  103.  
  104. function BdChoice (Choice  :integer) : Str32;
  105. {Get download CMD file name as a function of user's choice}
  106.  
  107. begin
  108.   case Choice of
  109.     1 : BdChoice := 'DL-PCB';
  110.     2 : BdChoice := 'DL-SRCE';
  111.     3 : BdChoice := 'DL-RBBS';
  112.     4 : BdChoice := 'DL-TBBS';
  113.     5 : BdChoice := 'DL-FIDO1';
  114.     6 : BdChoice := 'DL-VBG';
  115.     7 : BdChoice := 'DL-SPCL1';
  116.     8 : BdChoice := 'DL-SPCL2'
  117.   end
  118. end;
  119.  
  120.  
  121. procedure StrToUpper (var S : Str32);
  122.  
  123. var
  124.   i : integer;
  125.  
  126. begin
  127.   for i := 1 to length(S) do
  128.     S[i] := UpCase(S[i])
  129. end;
  130.  
  131.  
  132. procedure Done;
  133.  
  134. begin
  135.   Close(OutFile);
  136.   ClrScr;
  137.   GotoXY(28,10);
  138.   writeln('The CMD file is ready.')
  139. end;  {Done}
  140.  
  141.  
  142. procedure GetPathName;
  143.  
  144. var
  145.   Pathname : Str32;
  146.   Ch       : char;
  147.  
  148. begin
  149.   Pathname := '';
  150.   ClrScr;
  151.   GotoXY(5,5);
  152.   write('Do You need a pathname for your DL-.CMD file [Y] [C/R=N]?  ');
  153.     repeat
  154.       read (Kbd,Ch)
  155.     until Upcase(Ch) in ['Y',#13];
  156.     if (Upcase(Ch) = 'Y') then begin
  157.       GotoXY(6,13);
  158.       writeln('Pathname: ');writeln;
  159.       write('Examples:  "B:", "\PROCOMM\", or "C:\PROCOMM\" (Without the quotes).');
  160.       GotoXY(16,13);
  161.       read(Pathname);
  162.       StrToUpper(Pathname)
  163.     end;  {Pathname select}
  164.   writeln(OutFile,'EXEC "',Pathname,BdChoice(OutChoice),'"')
  165. end;  {GetPathName}
  166.  
  167.  
  168. procedure Files;
  169. {Get the filenanes and write them to the disk}
  170.  
  171. var
  172.   FileN    : Str12;
  173.   LongName : Str32;
  174.   FNCount  : byte;
  175.   Yes      : char;
  176.  
  177. begin
  178.   ClrScr;
  179.   FNCount := 0;
  180.   GotoXY(10,3);
  181.   write('***** To stop entering filenames hit return at the prompt. *****');
  182.   while (FNCount < 9 ) do begin
  183.     repeat
  184.       GotoXY(3,13);
  185.       write('                                                            ');
  186.       GotoXY(3,15);
  187.       write('                                                            ');
  188.       GotoXY(3,13);
  189.       write('The ',NumWord(FNCount),' filename to download? ');
  190.       readln(LongName);
  191.         if (LongName = '') then begin
  192.           writeln(OutFile,'ASSI S',FNCount+1,' "XXX"');
  193.           exit
  194.         end;     { Stop files list option }
  195.       GotoXY(3,15);
  196.       write('   Is the filename spelled correctly? ');
  197.       readln(Yes)
  198.     until (Yes in ['Y','y']);
  199.     FNCount := FNCount + 1;
  200.     StrToUpper(LongName);                       {to use StrToUpper}
  201.     FileN := LongName;                          {       "         }
  202.     writeln(OutFile,'ASSI S',FNCount,' "',FileN,'"')
  203.   end { While < 9 }
  204. end;  {Files}
  205.  
  206.  
  207. procedure SourceChoice;
  208. {Get choice of board in order to select DL